<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="jquery-1.10.1.min.js"></script>
</head>
<body>
    <input type="checkbox" name="" class="check-all">
    <p>
        <input type="checkbox" name="" class="check-one">
        <input type="checkbox" name="" class="check-one">
        <input type="checkbox" name="" class="check-one">
        <input type="checkbox" name="" class="check-one">
    </p>
</body>
<script>
$(".check-all").click(function(){
        $(".check-one").prop("checked",$(this).prop("checked"))
})
$(".check-one").click(function(){
    if($(".check-one").length==$(".check-one:checked").length){
        $(".check-all").prop("checked",true)
    }
    else{
        $(".check-all").prop("checked",false)
    }
})
</script>
</html>